<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>后台 - 彩金</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="__PUBLIC__/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/Admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/Admin/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form id="signform" method="post" action="{:U('Admin/Integral/caijin')}" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员名：<span style="color: red;">{$userinfo.nickname}</span></label>
                            <input type="hidden" name="userid" value="{$userinfo.id}"/>
                            <input type="hidden" name="fid" value="{$fid}"/>
                            <input type="hidden" name="type" value="{$type}"/>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">彩金点数</label>
                            <div class="col-sm-10">
                                <input type="text" id="points" name="points" value="{$points}" class="form-control"><span class="help-block m-b-none">彩金点数充值为整数</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">确认</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="__PUBLIC__/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/Admin/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/Common/js/ajaxForm.js"></script>
<script src="__PUBLIC__/Common/layer/layer.js"></script>
<script>
    $(function(){
        $('#signform').ajaxForm({
            beforeSubmit: checkForm,
            success: complete,
            dataType: 'json'
        });
        function checkForm(){
            if( '' == $.trim($('#points').val())){
                layer.alert('输入充值点数', {icon: 5}, function(index){
                    layer.close(index);
                    $('#points').focus();
                });
                return false;
            }
            $('.btn-primary').attr('disabled','disabled');
        }
        function complete(data){
            if(data.status==1){
                $('.btn-primary').attr('disabled','disabled');
                layer.msg(data.info, function(index){
                    layer.close(index);
                    window.parent.location.href=data.url;
                });
            }else{
                layer.msg(data.info);
                return false;
            }
        }
    });
</script>
</body>

</html>